Class TreeRedbObject<TProps>

Assembly: redb.Core.dll

ARCHITECTURAL FIX: Typed version of REDB tree object
NEW INHERITANCE: RedbObject<TProps> instead of TreeRedbObject
ADVANTAGES: Direct type casting, Props duplication elimination, no conversion
POLYMORPHISM: Implements ITreeRedbObject for untyped operations support

public class TreeRedbObject<TProps> : RedbObject<TProps>, ITreeRedbObject<TProps>, ITreeRedbObject, IRedbObject<TProps>, IRedbObject where TProps : class, new()

Inheritance

ObjectRedbObjectRedbObject<TProps>TreeRedbObject<TProps>

Implements

Inherited Members

Properties

Ancestors

Gets all node ancestors (from parent to root)

public IEnumerable<ITreeRedbObject> Ancestors { get; }

Children

Collection of child objects (untyped to support polymorphic trees)

public ICollection<ITreeRedbObject> Children { get; set; }

Descendants

Gets all node descendants recursively

public IEnumerable<ITreeRedbObject> Descendants { get; }

IsLeaf

TREE NAVIGATION PROPERTIES (moved from base TreeRedbObject)

public bool IsLeaf { get; }

Level

Gets node level in tree (0 for root)

public int Level { get; }

MaxDepth

Gets maximum depth of subtree from current node

public int MaxDepth { get; }

Parent

TREE-SPECIFIC PROPERTIES - untyped navigation

public ITreeRedbObject? Parent { get; set; }

SubtreeSize

Gets number of nodes in subtree (including current)

public int SubtreeSize { get; }

Methods

GetBreadcrumbs(string, bool)

Gets breadcrumbs for navigation

public string GetBreadcrumbs(string separator = " > ", bool includeIds = false)

GetPathIds()

NAVIGATION METHODS (moved from base TreeRedbObject)

public IEnumerable<long> GetPathIds()

GetSubtree()

Gets all subtree nodes (including current) in depth-first order

public IEnumerable<ITreeRedbObject> GetSubtree()

IsAncestorOf(ITreeRedbObject)

Checks if current node is ancestor of specified node

public bool IsAncestorOf(ITreeRedbObject descendant)

IsDescendantOf(ITreeRedbObject)

Checks if current node is descendant of specified node

public bool IsDescendantOf(ITreeRedbObject ancestor)